<html>
<head>
    <meta charset="UTF-8">
    <title>配置</title>
    <link rel="stylesheet" href="__CSS__/bootstrap.min.css">
    <link rel="stylesheet" href="__CSS__/elpis.min.css">
    <script src="__JS__/jquery-1.10.2.min.js"></script>
    <script type="text/javascript" src="__JS__/jquery.form.min.js"></script>
    <script type="text/javascript" src="__JS__/admin.js"></script>
    <script type="text/javascript" src="__STATIC__/layer/layer.js"></script>
</head>
<body>

<div class="box-info">
    <h3>货单号码</h3>
    <hr>
    <form class="myform" name="myform" action="{:U('Order/shippingSn')}" method="post">
        <div class="form-group">
            <label>货单号码：</label>
            <input type="text" name="shipping_sn" size="40" class="form-control" id="shipping_sn" value="{$order.shipping_sn}">
        </div>

        <input type="hidden" name="id" value="{$order.id}">
        <input name="submit" class="btn btn-primary" type="submit" value="确认">
    </form>
</div>

<script>
    var index = parent.layer.getFrameIndex(window.name); //获取窗口索引

    $(document).ready(function() {
        $('.myform').ajaxForm({
            success:  complete,  // post-submit callback
            dataType: 'json'
        });
    });

    function complete(data){
        if (data.status == 1) {
            parent.layer.msg(data.info, {
                icon: 1,
                time: 5000 //2秒关闭（如果不配置，默认是3秒）
            });
            parent.location.reload();
            parent.layer.close(index);
        } else {
            layer.msg(data.info, {
                icon: 2,
                time: 2000 //2秒关闭（如果不配置，默认是3秒）
            });
        }
    }
</script>

</body>
</html>